package com.yixun.qfbao.util;

import org.apache.commons.lang.StringUtils;


public class RuleUtil {
	public static String getRule(String str,String type){
		String result= "";
		if(StringUtils.isNotBlank(str)&&StringUtils.isNotBlank(type)){
			if("1".equals(type)){
				result = str.substring(str.indexOf(",")+1);
			}else if("2".equals(type)){
				String str1 = str.substring(0,str.indexOf(","));
				String str2 = str.substring(str.lastIndexOf(",")+1);
				result = str1 +"-"+str2;
			}else if("3".equals(type)){
				result = str.substring(0,str.indexOf(","));
			}
		}
		return result;
	}
}
